package com.t216.dm216.pojo.dto;

import com.t216.dm216.common.Constant;
import lombok.Data;

import java.io.Serializable;

@Data
public class Token implements Serializable {
    private String token;
    private Long expTime;
    private Long genTime;

    private Token(){}

    public static Token getToken(String tokenInfo){
        synchronized (Token.class){
            Token token = new Token();
            token.setToken(tokenInfo);
            token.setGenTime(System.currentTimeMillis());
            token.setExpTime(System.currentTimeMillis() + Constant.EXP_TIME);
            return token;
        }
    }
}
